package com.cgmnx.admin.model.enums.rbac;


import com.cgmnx.admin.common.enums.EnumTrait;

public enum ResourceType implements EnumTrait {

    NAV(0, "导航"),
    MENU(1, "菜单"),
    BODY(2, "按钮或接口");

    private int code;
    private String desc;

    ResourceType(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ResourceType codeOf(int code) {
        for (ResourceType st : ResourceType.values()) {
            if (st.code == code) {
                return st;
            }
        }
        return null;
    }

    @Override
    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


}
